package com.dnf.servlet;

import java.io.IOException;
import java.io.PrintWriter;


import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.dnf.service.GoodsPriceService;

/**
 * @author Administrator
 *
 */
public class PriceServlet extends HttpServlet {


	public PriceServlet() {
		super();
	}


	public void destroy() {
		super.destroy(); // Just puts "destroy" string in log
	}

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		GoodsPriceService service = new GoodsPriceService();
    	String [] goodsNames = new String[]{"魔刹石","深渊派对挑战书","无色小晶块","龙之挑战","兽人守护神"};
    	int diffMonth = -6;
    	for(String goodsName : goodsNames)
    	 service.getPriceFromWeb(goodsName, diffMonth);
		out.flush();
		out.close();
	}
	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

	public void init() throws ServletException {
		// Put your code here
	}

}
